﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Foundation {
    public class EffektGroup {
         /// <summary>
        /// Der Name der Kategorie
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// Der Key, welcher die Kategorie bezeichnet
        /// </summary>
        public char Key { get; set; }
        /// <summary>
        /// Die zur Kateorie zugehörigen Effekte
        /// </summary>
        public Dictionary<char, Effekt> Effects { get; set; }

        public List<string> FreeKeys { get; set; }

        /// <summary>
        /// ID der EffektGroup
        /// </summary>
        public Guid ID{ get; set; }


        public EffektGroup() {
            this.ID = Guid.NewGuid();
            this.Effects = new Dictionary<char, Effekt>();
            this.FreeKeys = new List<string> { "a", "b", "c", "d", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
        }

        /// <summary>
        /// Gibt eine Liste mit den Namen aller Elemente aus der Kategorie zurück
        /// </summary>
        /// <returns></returns>
        public string[] GetEffektItemList() {
            List<string> items = new List<string>();

            foreach (KeyValuePair<char, Effekt> pair in this.Effects) {
                items.Add(string.Format("{0} - {1}", pair.Key, pair.Value.Name));
            }
            return items.ToArray();
        }

        
        public override string ToString() {
            return string.Format("{0} - {1}", this.Key, this.Name); 
        }


        
    }
}
